﻿using System;
using System.Collections.Generic;
using System.ComponentModel; 
using NTTDATA.BEENChina.ResultCertification.Config;

namespace NTTDATA.BEENChina.ResultCertification.Checker.Numeric
{
   
    [Serializable]
    [VerfityAttribute(Id = "VerfityD0100", Name = "第N行N列通院治疗日有/无记载", CategoryType = EnumCategoryType.数值, Model = true)]
    public class VerfityD0100 : VerfityOneResult
    {

        [Category("设定检查的行列"), Description("要检查的列")]
        public int Cloumn { get; set; }

        [Category("设定检查的行"), Description("要检查的行")]
        public int Row { get; set; }

        [Category("有/无记录"), Description("true:有通院治疗日 false:无通院治疗日")]
        public bool Exists { get; set; }

        public override bool CheckResult(List<List<string>> result, string entryCommon)
        {
            bool bresult = false;
            if (result == null || 
                entryCommon.Equals("30") ||
                EntryResultIsEmpty(result )
                )
            {
                return false;
            }

            
            bresult = CheckSpecificRowIsEmpty(result, GetSpeicficResult, Exists, Row, Cloumn);

            if (bresult)
            {
                System.Console.WriteLine("VerfityD0100");
            }

            return bresult;
        }

        protected   string GetSpeicficResult(string colStr)
        {
            var splitEntryResult =
                new Split.SplitEntryResult(
                    ChildImageObject.CategorySetting.DataFormat, colStr);
            var mdRsult = splitEntryResult.GetMd();

            return mdRsult;
        }
       
    }
}
